import http from "./request/request";

// 查询用户
const userqueryAll = (data) => {
  return http.post("/user/queryAll", data);
};
// 添加用户
const useradd = (data) => {
  return http.post("/user/add", data);
};
// 删除
const userdelete = (data)=>{
  return http.post("/user/delete", data);
};

//角色 有分页菜单
const rolequeryAll = (data) => {
  return http.post("/role/roleMenuAll", data);
};
// 查询所有的角色 无分页无菜单
const roleMenuAll = (data) => {
  return http.post("/role/queryAll", data);
};
// 添加
const roleadd = (data) => {
  return http.post("/role/add", data);
};
// 删除
const roledelete = (data) => {
  return http.post("/role/delete", data);
};
// 修改
const roleupdata = (data) => {
  return http.post("/role/updata", data);
};

// 获取所有菜单
const menuqueryAll = (data) => {
  return http.post("/menu/queryAll", data);
};
// 获取菜单数据
const queryCountAll = (data) => {
  return http.post("/menu/queryCountAll", data);
};
// 添加菜单
const menuadd = (data) =>{
  return http.post('/menu/add',data)
}
// 删除菜单
const menudele = (data) =>{
  return http.post('/menu/delete',data)
}
const menuUpdata = (data) =>{
  return http.post('/menu/updata',data)
}
// 登录
const login = (data) =>{
  return http.post('/login',data)
}


// 新闻

// 查询 不分页
export const newsqueryAll = (data) => {
  return http.post("/news/queryAll", data);
};
// 查询
export const newsquery = (data) => {
  return http.post("/news/query", data);
};

// 添加
export const newsadd = (data) => {
  return http.post("/news/add", data);
};
// 修改
export const newsupdata = (data) => {
  return http.post("/news/updata", data);
};

//	删除
export const newsdelete = (data)=>{
  return http.post("/news/delete", data);
};

// 咨询
// 查询
export const counselorqueryAll = (data) => {
  return http.post("/counselor/queryAll", data);
};
// 添加
export const counseloradd = (data) => {
  return http.post("/counselor/add", data);
};

// 修改
export const counselorupdata = (data)=>{
  return http.post("/counselor/updata", data);
};

// 删除
export const counselordelete = (data)=>{
  return http.post("/counselor/delete", data);
};

// 小程序
// 查询
export const usersqueryAll = (data) => {
  return http.post("/users/queryAll", data);
};
// 添加
export const usersadd = (data) => {
  return http.post("/users/add", data);
};

// 修改
export const usersupdata = (data)=>{
  return http.post("/users/updata", data);
};

// 删除
export const usersdelete = (data)=>{
  return http.post("/users/delete", data);
};




// 上传文件
const updata = (data)=>{
  return http.updata('/uploand/avatar',data)
}

export {
  userqueryAll,
  updata,
  useradd,
  userdelete,
  rolequeryAll,
  roleadd,
  roledelete,
  roleupdata,
  menuqueryAll,
  roleMenuAll,
  menuadd,
  queryCountAll,
  login,
  menudele,
  menuUpdata
};